package com.djl.sqtg.service.impl;

import com.djl.sqtg.entity.Cart;
import com.djl.sqtg.entity.CartVO;
import com.djl.sqtg.mapper.CartMapper;
import com.djl.sqtg.service.ICartService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CartServiceImpl implements ICartService {
    @Autowired
    private CartMapper cartMapper;

    @Override
    public List<CartVO> getCartByUid(Integer uid) {return cartMapper.getCartByUid(uid);}

    @Override
    public Integer updateCartState(Integer cid,Integer goodsState) {return cartMapper.updateCartState(cid,goodsState);
    }

    @Override
    public Integer deletCartByCid(Integer cid) {return cartMapper.deletCartByCid(cid);}

    @Override
    public Integer addCart(Integer uid, Integer gid) {return cartMapper.addCart(uid,gid);}

    @Override
    public Integer updateCartNum(Integer uid, Integer gid,Integer num) {return cartMapper.updateCartNum(uid,gid,num);}

    @Override
    public Integer updateCartNumBycid(Integer cid, Integer num) {return cartMapper.updateCartNumBycid(cid, num);
    }

    @Override
    public Cart findCartByUidGid(Integer uid, Integer gid) {
        return cartMapper.findCartByUidGid(uid,gid);
    }
}
